package com.tiankun.eurekauserinfo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA
 * User: bear
 * Date: 2020/11/12
 * Description
 * Version: V1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Table(name = "tb_order")
public class Order implements Serializable {

    //订单id
    //user id
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY) //设置id主键的策略为IDENTITY，作为自动增长策略
    private Integer id;
    //用户电话
    @Column(name = "user_phone")
    private String userPhone;

    //订单状态，0，未付款，1：已付款，但订单未完成，2,：订单已完成
    @Column(name = "order_state")
    private Integer state;

    //订单号，由产生订单的时间加上六位随机数生成
    @Column(name = "order_random")
    private String orderRandom;

    //交易金额
    @Column(name = "order_money")
    private Integer money;

    @Column(name = "ticket_id")
    private Integer ticketId;

    //商品详情
    List<OrderGoods> goods;

}
